package com.cf.expensetracker.command;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
import com.beust.jcommander.Parameters;
import lombok.Data;

/**
 * Copyright(C) 2025- com.cf
 * FileName:    SummaryCmd
 * Author:      cf
 * Date:        2025/1/21 21:53
 * Description: Command for viewing a summary of all expenses
 */
@Data
@Parameters(commandNames = "summary", commandDescription = "View summary of all expense")
public class SummaryCmd {
    @Parameter(names = "--month", description = "A specific month (of current year)")
    private Integer month;

    public void validate() throws ParameterException {
        if (month < 1 || month > 12) {
            throw new ParameterException("The month must be between 1 and 12.");
        }
    }
}
